<%@ page language="java" import="myclass.User" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>系统验证</title>
</head>
<body>
<%
       String myusername=request.getParameter("username");
       String mypassword=request.getParameter("password");
       if(myusername!=null&&myusername.equals("admin")){
    	   if(mypassword!=null&&mypassword.equals("123456")){
    		   //out.println("登录成功");
    		   User user=new User();
    		   user.setName(myusername);
    		   user.setPassword(mypassword);
    		   session.setAttribute("user", user);
    		   response.sendRedirect("index.jsp");
    	   }else{
    		   out.println("密码错误!<a href='login.jsp'>重新登录</a>");
    	   }
       }else{
    		   out.println("密码错误!<a href='login.jsp'>重新登录</a>");
       }
%>
</body>
</html>